The format of the .maildelivery file is
The file is always read completely so that several matches can be made, and several actions taken. As a security check, the .maildelivery file must be owned by either the user or root, and must not have group or general write permission. For example:
-rw-r--r-- 1 long.csnet 522 Mar 8 15:06 .maildeliveryIn addition the system delivery file has the above restrictions but must also be owned by root. If the field specified does not need a pattern a dash (-) or similar symbol is usually inserted to show that the field is present but not used. The field separator character can be either a tab, space or comma (,). These characters can be included in a string by quoting them with double quotes (") (double quotes can be included with a backslash (\)).
MMDF treats local addresses which contain an equal sign (=) in a special manner. Everything in a local address from an equal sign to the at sign (@) is ignored and passed on to the local channel. The local channel will make the entire string available for matching against the addr string of the .maildelivery file. For example, if you were to subscribe to a digest as "foo=digest@bar.NET", submit and the local channel will verify that it is legal to deliver to "foo", but then the entire string "foo=digest" will be available for string matching against the .maildelivery file for the addr field.
HOME is set to the user's home directory. USER is set to the user's login name. SHELL is set to the user's login shell (defaults to /bin/sh).The default umask is set up to 077, this gives a very protective creation mask. Initgroups is called if 4.2 version of UNIX is running. If further requirements are needed, then a shell script can be run first to set up more complex environments.
There are certain built-in variables that you can give to a piped program. These are $(sender), $(address), $(size), $(reply-to) and $(info). $(sender) is set to the return address for the message. $(address) is set to the address that was used to mail to you, normally `yourname' or `yourname=string'. $(size) is set to the size in bytes of this message. $(reply-to) is set to the Reply-To: field (or the From: field if the former is missing) and so can be used for automatic replies. $(info) is the info field from the internal mail header and is probably only of interest to the system maintainers.
Here is a rough idea of what a .maildelivery file looks like:
# lines starting with a '#' are ignored. # as are blank lines # file mail with mmdf2 in the "To:" line into file mmdf2.log To~~~~mmdf2~~~~file~~~~A~~~~mmdf2.log # Messages from mmdf pipe to the program err-message-archive From~~~~mmdf~~~~pipe~~~~A~~~~err-message-archive # Anything with the "Sender:" address "uk-mmdf-workers" # file in mmdf2.log if not filed already Sender~~~~uk-mmdf-workers~~~~file~~~~?~~~~mmdf2.log # "To:" unix - put in file unix-news To~~~~Unix~~~~>~~~~A~~~~unix-news # if the address is jpo=mmdf - pipe into mmdf-redist Addr~~~~jpo=mmdf~~~~|~~~~A~~~~mmdf-redist # if the address is jpo=ack - send an acknowledgement copy back Addr~~~~jpo=ack~~~~|~~~~R~~~~resend~~-r~~$(reply-to) # anything from steve - destroy! from~~~~steve~~~~destroy~~~~A~~~~- # anything not matched yet - put into mailbox default~~~~-~~~~>~~~~?~~~~mailbox # always run rcvalert *~~~~-~~~~|~~~~R~~~~rcvalert~~$(size)
default~~~~-~~~~pipe~~~~A~~~~stdreceive *~~~~~~~~~-~~~~pipe~~~~R~~~~ttynotify
This allows interfacing to non-standard mail systems, ones that don't believe in delimiter-separated mailboxes
(Maybe because someone forgot?)